package com.mxf.springcloud.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author : [mxf]
 * @version : [v1.0]
 * @className : GateWayConfig
 * @description : [描述说明该类的功能]
 * @createTime : [2022/10/1 19:58]
 * @updateUser : [mxf]
 * @updateTime : [2022/10/1 19:58]
 * @updateRemark : [描述说明本次修改内容]
 */
@Configuration
public class GateWayConfig {
    @Bean
    public RouteLocator customRouteLocator(RouteLocatorBuilder routeLocatorBuilder)
    {
        RouteLocatorBuilder.Builder routes = routeLocatorBuilder.routes();

        routes.route("path_route_zdy",
                r -> r.path("/guonei")
                        .uri("http://news.baidu.com/guonei")).build();

        return routes.build();
    }
}
